package com.netease.financial.internal.di.modules;

import com.netease.financial.base.splash.SplashPresenter;
import com.netease.financial.base.splash.SplashPresenterImpl;
import com.netease.financial.domain.executor.PostExecutionThread;
import com.netease.financial.domain.executor.ThreadExecutor;
import com.netease.financial.domain.interactor.GetLaunchPageInfo;
import com.netease.financial.domain.interactor.UseCase;
import com.netease.financial.domain.repository.NfsRepository;
import com.netease.financial.internal.di.ActivityScope;

import javax.inject.Named;

import dagger.Module;
import dagger.Provides;

/**
 * Created by hzwuyufeng on 2/15/16.
 */
@Module
public class SplashModule {

    private final int widthPixels;

    private final int heightPixels;

    // 应用平台/android或ios等
    private final String platform;

    public SplashModule(int widthPixels, int heightPixels, String platform) {
        this.widthPixels = widthPixels;
        this.heightPixels = heightPixels;
        this.platform = platform;
    }

    @Provides
    @ActivityScope
    SplashPresenter provideSplashPresenter(SplashPresenterImpl splashPresenter) {
        return splashPresenter;
    }

    @Provides
    @ActivityScope
    @Named("launch_page")
    UseCase provideGetLaunchPageUseCase(NfsRepository nfsRepository,
                                        ThreadExecutor threadExecutor,
                                        PostExecutionThread postExecutionThread) {
        return new GetLaunchPageInfo(widthPixels, heightPixels, platform, nfsRepository, threadExecutor, postExecutionThread);
    }
}
